<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
	<meta charset="UTF-8">
	<title>自助点单</title>
	<meta name="page-view-size" content="1280*720">
	<link rel="stylesheet" href="css/base.css">
	<link rel="stylesheet" href="css/selfHelpOrder.css">
	<script type="text/javascript" src="lib/js/evm.js"></script>
	<script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
	<script type="text/javascript" src="lib/js/key.js"></script>
	<script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/api.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/public.js" type="text/javascript" charset="utf-8"></script>
	<style>
		.model:nth-child(4) {
			display: block;
			width: 100px;
			height: 35px;
			position: absolute;
			top: 450px;
			left: 170px;
			text-align: center;
			background: url(../images/like-1.png) no-repeat;
			background-position: top center;
			background-size: 60px 60px;
			padding-top: 80px;
			font-size: 15px;
			color: #fff;
		}

		
	</style>
</head>

<body>
	<div class="theoretical-bg" id="theoreticalMain">
		<div class="title"></div>
		<div id="white-bg"></div>
		<div id="blue-bg"></div>
		<div class="items">
		</div>
	</div>


	<!-- <div class=containDe>
		<div class=brief id=brief>
			<img src=images/brief.png>
			<div class=orange>求助内容</div>
			<div class=div id=div></div>
		</div>
	</div> -->
</body>
<script>
	var modelIndex = {
		disUser: true,
		specialState: 'didi',
		index: 0, //初始位置
		listName: 'model', //模块名称
		containerId: 'theoreticalMain', //包含模块的标签id
		thisContain: 'container', //翻滚外容器
		thisDetail: 'div', //翻滚内容
		api: 'helpDetail'
	}
	var articleRun;
	var bottomData = [{
			scores: '1',
			img_url: "images/star1.png",
			img_point: "images/star2.png"
		},
		{
			scores: '2',
			img_url: "images/star1.png",
			img_point: "images/star2.png"
		},
		{
			scores: '3',
			img_url: "images/star1.png",
			img_point: "images/star2.png"
		},
		{
			scores: '4',
			img_url: "images/star1.png",
			img_point: "images/star2.png"
		},
		{
			scores: '5',
			img_url: "images/star1.png",
			img_point: "images/star2.png"
		}
	];
	var indexstar = 4;

	function getMessage() {
		var param = {
			id: TV.GetParam("order_id")
		}
		GetDatas(modelIndex.api, param, function (err, res) {
			var str = '';
			mess = res.data;
			console.log(res.data, 'mess');
			if (mess.help_type == '' || mess.help_type == null) {
				var help_typedata = '其它';
			} else {
				var help_typedata = mess.help_type;
			}
			if (mess.status == 0) {
				str += '<div class=erweima><img class=erweimas src=images/erweima.png>微信扫码接单</div>'
			} else {
				str += '<div class=erweima><img class=erweimas src=images/erweima.png>微信扫码分享</div>'
			}

			str +=
				'<div class=contain><div class=starttime><img src=images/time.png><div class=orange>点单时间</div>' +
				mess.format_add_time + '</div></div>'
			if (mess.address == "" || mess.address == null) {

			} else {
				str +=
					'<div class=contain><div class=organization><img src=images/address.png><div class=orange>点单地址</div>' +
					mess.address + '</div></div>'
			}

			// str += '<div class=contain><div class=address><img src=images/team.png><div class=orange>点单类型</div>' +
			// 	help_typedata + '</div></div>'
			str +=
				'<div class=contain><div class=contacts><img src=images/person.png><div class=orange>点单人</div>' +
				mess.username + '</div></div>' +
				'<div class=contain><div class=tel><img src=images/phone.png><div class=orange>联系电话</div>' +
				mess
				.mobile + '</div></div>'
			if (mess.status == 1) {
				str +=
					'<div class=contain><div class=contacts><img src=images/person.png><div class=orange>接单人</div>' +
					mess.help_name + '</div></div>' +
					'<div class=contain><div class=tel><img src=images/phone.png><div class=orange>联系电话</div>' +
					mess
					.help_mobile + '</div></div>'
			}
			if (mess.status == 3) {
				str +=
					'<div class=contain><div class=contacts><img src=images/person.png><div class=orange>接单人</div>' +
					mess.helps[0].name + '</div></div>'
			}
			str +=
				'<div class=containDe><div class=brief><img src=images/brief.png><div class=orange>点单内容</div><div class=container id=container><div class=div id=div>' +
				mess.content + '</div></div></div></div>';
			if (mess.status == 3) {
				str +=
					'<div class=contain><div class=contacts><img src=images/pingjia.png><div class="orange">服务评价</div>'
				if (bottomData.length > 0) {
					var strs = '';
					for (var i = 0; i < bottomData.length; i++) {
						if (i < mess.scores) {
							strs += '<div class="star" data-id=' + bottomData[i].scores + '>';
							strs += '<img src=' + bottomData[i].img_point + '></div>';
						} else {
							strs += '<div class="star" data-id=' + bottomData[i].scores + '>';
							strs += '<img src=' + bottomData[i].img_url + '></div>';

						}
					}
					//console.log(str, "str")
				}
				str += strs
				// str += mess.helps[0].name 
				str += '</div></div>'

			}
			$('.title').html(mess.title);
			var surl = API_URL.loginURL + "home/index/qrcode?url=" + encodeURIComponent(
				API_URL.helpUrl + '/' + TV.GetParam('order_id'))

			$('.items').html(str)
			$('.erweimas').attr('src', surl)
			// if (mess.status == 3) {
			// 	$('.erweima').css('display', "none")
			// }
		})
		// right.toggleFocus();
	}

	getMessage();

	function direOpt(index, directive) {
		if (directive == "up") { //上
			switch (index) {
				case 3:
					index = 0;
					break;
			}
			console.log('toptop')

			if (index == 0) { //文章翻滚
				TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
			}
		} else if (directive == "down") { //下
			if (index == 0) { //文章翻滚
				console.log(index, directive, modelIndex.thisContain, modelIndex.thisDetail, '21212')
				TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
			}
		} else if (directive == "backwards") { //左
			switch (index) {
				case 1:
					index = 2;
					break;
				case 2:
					index = index;
					break;
				case 3:
					index = 1;
					break;
			}

		} else if (directive == "forwards") {
			switch (index) {
				case 1:
					index = 3;
					break;
				case 2:
					index = 1;
					break;
				case 3:
					index = index;
					break;
			}
			clearInterval(articleRun)
		}
		return index;
	}
</script>
<script type="text/javascript" src="js/index.js"></script>

</html>